You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just quickly syncing prod with main as I'm assuming we will take a bit more time to test main branch after pottentially merging the new staking squid integration next
Logic Change The logic for displaying the StatusIcon has changed significantly. Previously, the icon was displayed if the transaction status was not pending. Now, it checks explicitly for success and pending statuses. This change could affect how transaction statuses are represented in the UI. It's important to ensure that this new logic correctly handles all expected transaction statuses and that there are no edge cases or statuses that are not accounted for.
Component Update The StatusIcon component now handles an additional prop isPending and includes a new icon for the pending state. This change requires careful testing to ensure that the icons are rendered correctly in all scenarios where StatusIcon is used. Additionally, the removal of the ClockIcon in the failure state and its replacement with the XCircleIcon should be verified for correct visual representation and user understanding.
Improve data handling and error checking in setLatestConfirmedDomainExecutionReceipt to prevent runtime errors
When setting state for latestConfirmedDomainExecutionReceipt, ensure that the data structure and types are correctly handled to prevent runtime errors. This includes proper handling of nullable or undefined values and ensuring that the data conforms to expected types.
setLatestConfirmedDomainExecutionReceipt(
- latestConfirmedDomainExecutionReceipt.map((domainBlock) => ({- id: parseInt((domainBlock[0].toHuman() as string[])[0]),- ...(domainBlock[1].toJSON() as Omit<ConfirmedDomainExecutionReceipt, 'id'>),- })),+ latestConfirmedDomainExecutionReceipt.map((domainBlock) => {+ const id = parseInt((domainBlock[0].toHuman() as string[])[0]);+ const receipt = domainBlock[1].toJSON() as Omit<ConfirmedDomainExecutionReceipt, 'id'>;+ return { id, ...receipt };+ }).filter(item => !isNaN(item.id) && item != null),
)
Suggestion importance[1-10]: 10
Why: The suggestion improves data handling and error checking, which is crucial for preventing runtime errors. This enhancement is highly valuable for maintaining robust and error-free code.
10
Possible bug
Add handling for non-pending and unsuccessful transaction status in the StatusIcon component
The StatusIcon component should handle a case where isPending is false and status is also false. Currently, it only checks for isPending and then directly returns the ClockIcon. This might lead to incorrect icon display when the transaction is neither pending nor successful.
Why: The suggestion correctly identifies a potential bug where the icon might not display correctly for failed transactions. The improved code ensures that all possible statuses are handled, improving the component's reliability.
9
Best practice
Use environment variables for managing external URLs to improve maintainability and security
Consider using environment variables or a configuration file for managing URLs such as image sources. This approach enhances maintainability and security by centralizing URL management, making it easier to update or secure URLs without modifying component files directly.
Why: Using environment variables for URLs is a best practice that improves maintainability and security. This suggestion is valid and beneficial, although it addresses a minor issue.
8
Enhancement
Ensure StatusIcon handles all transaction statuses including failed transactions
The StatusIcon component usage in PendingTransactions.tsx should include a default case for when neither status is Success nor Pending. This ensures that the icon correctly represents the transaction status in all scenarios.
Why: The suggestion enhances the StatusIcon usage by ensuring it handles all transaction statuses, including failed transactions. However, the PR code does not define a Failed status, making this suggestion less immediately applicable.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Sync prod with main
Just quickly syncing prod with main as I'm assuming we will take a bit more time to test main branch after pottentially merging the new staking squid integration next
Including PR's
PR Type
Enhancement, Bug fix
Description
subspace.network
toautonomys.xyz
across multiple files.StatusIcon
component to handle pending and failed statuses.ConfirmedDomainBlock
toConfirmedDomainExecutionReceipt
and updated related logic and type definitions.Farming
component.Changes walkthrough 📝
11 files
index.tsx
Update image source URL and clean up whitespace
explorer/src/components/Farming/index.tsx
autonomys.xyz
.PendingTransactions.tsx
Enhance `StatusIcon` handling for transaction statuses
explorer/src/components/WalletSideKick/PendingTransactions.tsx
StatusIcon
component to handle pending and success statuses.StatusIcon.tsx
Add failed status icon and enhance `StatusIcon` component
explorer/src/components/common/StatusIcon.tsx
XCircleIcon
for failed status.StatusIcon
component to handle pending and failed statuses.metadata.ts
Update metadata URL to `autonomys.xyz`
explorer/src/constants/metadata.ts
subspace.network
toautonomys.xyz
.routes.ts
Update external routes to `autonomys.xyz`
explorer/src/constants/routes.ts
autonomys.xyz
.useConsensusData.ts
Rename `ConfirmedDomainBlock` to `ConfirmedDomainExecutionReceipt`
explorer/src/hooks/useConsensusData.ts
ConfirmedDomainBlock
toConfirmedDomainExecutionReceipt
.consensus.ts
Update consensus state management for renamed type
explorer/src/states/consensus.ts
ConfirmedDomainBlock
toConfirmedDomainExecutionReceipt
.consensus.ts
Update type definition for renamed consensus type
explorer/src/types/consensus.ts
ConfirmedDomainBlock
toConfirmedDomainExecutionReceipt
.nova.ts
Update auth provider domain to `autonomys.xyz`
explorer/src/utils/auth/providers/nova.ts
subspace.network
toautonomys.xyz
.next.config.js
Update remote image hostname to `autonomys.xyz`
explorer/next.config.js
autonomys.xyz
.package.json
Update package author URL to `autonomys.xyz`
indexers/staking-squid/package.json
autonomys.net
toautonomys.xyz
.2 files
README.md
Update README URLs to `autonomys.xyz`
README.md
subspace.network
toautonomys.xyz
.README.md
Update staking squid README URLs to `autonomys.xyz`
indexers/staking-squid/README.md
subspace.network
toautonomys.xyz
.